Conversation
Thomas-S-Allen
left a comment
There was a problem hiding this comment.
Line 295 in solve.py if scix_id or bibcode are missing this line could break. Could use sol.get("scix_id", None) and sol.get("bibcode", None) instead. Same for the logging code on line 291.
This brings up another question, it seems that the Solution class, lines 257-290 in common.py, requires cited_bibcode. Should it be set to cited_bibcode=None in the initialization on line 267. Similar should there be a cited_scix_id and citing_scix_id.
Also with the solution class, do you always want both bibcode and scix_id to be part of the return string, or make it conditional in case one is not available. Making it conditional would require changing 126-129 in views.py to no longer parse based on position. Could use a regex instead to match for bibcode:... and scixid:... separately, or possibly another method that is not position based.
Also, if the return string, line 287 in common.py, has scix_id instead of scixid it would be more consistent with how scix_id is used throughout the code. Or would that cause more difficulty downstream in views.py, lines 126-129.
Technically Solr records should always have a
I don't understand why
Yes, my preference is to keep both
I decided to use |
|
For the additional commit to this PR: I'm leaving the The biggest additions in this latest commit are the cases where Things get a little tricky here where there are explicit assumptions on matches that just have bibcodes and scores. The current solution is a work-around that seems adequate. |
This PR represents the work done to include the SciX ID in the output of the service. In order to achieve this goal, the following was done
config.pyto include the Solr fieldscix_idinREFERENCE_SERVICE_QUERY_FIELDS_SOLRso that this field is always present when results (i.e. potential matches) are retrieved from Solr/textor/xmlendpoint is used to submit reference data, the actual processing always ends up in the function solve_for_fields. Here the contents of the Solr fieldscix_idneed to be passed on when creating theSolutioninstance sent backscix_idattribute. The string representation of class instances__str__needs to be updated to include the value of this attribute. This is because the result of the matching process is passed on as str(solve_reference(Hypotheses(parsed_ref))) (theresolve_referencereturns aSolutioninstance).Solutioninstance and creating a JSON structure with the results of the matching